/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.unal.bioingenium.kbmed.util.math;

/**
 *
 * @author lariverosc
 */
public class UtilMath {

    private static double LOG2 = Math.log(2);

    /**
     * 
     * @param val
     * @return
     */
    public static double log2(double val) {
        return Math.log(val) / LOG2;
    }

    /**
     * 
     * @param val
     * @return
     */
    public static float log2(float val) {
        return (float) (Math.log(val) / LOG2);
    }

    /**
     * 
     * @param num
     * @return
     */
    public static int indicator(double num) {
        if (num > 0) {
            return 1;
        }
        return 0;
    }
}
